# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PubSubLite.V1.Model.ComputeMessageStatsRequest do
  @moduledoc """
  Compute statistics about a range of messages in a given topic and partition.

  ## Attributes

  *   `endCursor` (*type:* `GoogleApi.PubSubLite.V1.Model.Cursor.t`, *default:* `nil`) - The exclusive end of the range. The range is empty if end_cursor <= start_cursor. Specifying a start_cursor before the first message and an end_cursor after the last message will retrieve all messages.
  *   `partition` (*type:* `String.t`, *default:* `nil`) - Required. The partition for which we should compute message stats.
  *   `startCursor` (*type:* `GoogleApi.PubSubLite.V1.Model.Cursor.t`, *default:* `nil`) - The inclusive start of the range.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endCursor => GoogleApi.PubSubLite.V1.Model.Cursor.t() | nil,
          :partition => String.t() | nil,
          :startCursor => GoogleApi.PubSubLite.V1.Model.Cursor.t() | nil
        }

  field(:endCursor, as: GoogleApi.PubSubLite.V1.Model.Cursor)
  field(:partition)
  field(:startCursor, as: GoogleApi.PubSubLite.V1.Model.Cursor)
end

defimpl Poison.Decoder, for: GoogleApi.PubSubLite.V1.Model.ComputeMessageStatsRequest do
  def decode(value, options) do
    GoogleApi.PubSubLite.V1.Model.ComputeMessageStatsRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PubSubLite.V1.Model.ComputeMessageStatsRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
